Optimal. Leaf size=130 \[ \frac {5 x}{2 a}+\frac {3 i \log (\cos (c+d x))}{a d}-\frac {5 \tan (c+d x)}{2 a d}+\frac {3 i \tan ^2(c+d x)}{2 a d}+\frac {5 \tan ^3(c+d x)}{6 a d}-\frac {3 i \tan ^4(c+d x)}{4 a d}-\frac {\tan ^5(c+d x)}{2 d (a+i a \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 130, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3631, 3609,
3606, 3556} \begin {gather*} -\frac {\tan ^5(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {3 i \tan ^4(c+d x)}{4 a d}+\frac {5 \tan ^3(c+d x)}{6 a d}+\frac {3 i \tan ^2(c+d x)}{2 a d}-\frac {5 \tan (c+d x)}{2 a d}+\frac {3 i \log (\cos (c+d x))}{a d}+\frac {5 x}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3606
Rule 3609
Rule 3631
Rubi steps
\begin {align*} \int \frac {\tan ^6(c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac {\tan ^5(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {\int \tan ^4(c+d x) (5 a-6 i a \tan (c+d x)) \, dx}{2 a^2}\\ &=-\frac {3 i \tan ^4(c+d x)}{4 a d}-\frac {\tan ^5(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {\int \tan ^3(c+d x) (6 i a+5 a \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac {5 \tan ^3(c+d x)}{6 a d}-\frac {3 i \tan ^4(c+d x)}{4 a d}-\frac {\tan ^5(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {\int \tan ^2(c+d x) (-5 a+6 i a \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac {3 i \tan ^2(c+d x)}{2 a d}+\frac {5 \tan ^3(c+d x)}{6 a d}-\frac {3 i \tan ^4(c+d x)}{4 a d}-\frac {\tan ^5(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {\int \tan (c+d x) (-6 i a-5 a \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac {5 x}{2 a}-\frac {5 \tan (c+d x)}{2 a d}+\frac {3 i \tan ^2(c+d x)}{2 a d}+\frac {5 \tan ^3(c+d x)}{6 a d}-\frac {3 i \tan ^4(c+d x)}{4 a d}-\frac {\tan ^5(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {(3 i) \int \tan (c+d x) \, dx}{a}\\ &=\frac {5 x}{2 a}+\frac {3 i \log (\cos (c+d x))}{a d}-\frac {5 \tan (c+d x)}{2 a d}+\frac {3 i \tan ^2(c+d x)}{2 a d}+\frac {5 \tan ^3(c+d x)}{6 a d}-\frac {3 i \tan ^4(c+d x)}{4 a d}-\frac {\tan ^5(c+d x)}{2 d (a+i a \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(840\) vs. \(2(130)=260\).
time = 6.58, size = 840, normalized size = 6.46 \begin {gather*} \frac {5 x \cos (c) \sec (c+d x) (\cos (d x)+i \sin (d x))}{2 (a+i a \tan (c+d x))}+\frac {3 \text {ArcTan}(\tan (d x)) \cos (c) \sec (c+d x) (\cos (d x)+i \sin (d x))}{d (a+i a \tan (c+d x))}+\frac {3 i \cos (c) \log \left (\cos ^2(c+d x)\right ) \sec (c+d x) (\cos (d x)+i \sin (d x))}{2 d (a+i a \tan (c+d x))}+\frac {\cos (2 d x) \sec (c+d x) \left (-\frac {1}{4} i \cos (c)-\frac {\sin (c)}{4}\right ) (\cos (d x)+i \sin (d x))}{d (a+i a \tan (c+d x))}+\frac {\sec ^3(c+d x) \left (\frac {1}{6} i \cos (c)-\frac {\sin (c)}{6}\right ) (9 \cos (c)-2 i \sin (c)) (\cos (d x)+i \sin (d x))}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) (a+i a \tan (c+d x))}+\frac {\sec ^5(c+d x) \left (-\frac {1}{4} i \cos (c)+\frac {\sin (c)}{4}\right ) (\cos (d x)+i \sin (d x))}{d (a+i a \tan (c+d x))}+\frac {5 i x \sec (c+d x) \sin (c) (\cos (d x)+i \sin (d x))}{2 (a+i a \tan (c+d x))}+\frac {3 i \text {ArcTan}(\tan (d x)) \sec (c+d x) \sin (c) (\cos (d x)+i \sin (d x))}{d (a+i a \tan (c+d x))}-\frac {3 \log \left (\cos ^2(c+d x)\right ) \sec (c+d x) \sin (c) (\cos (d x)+i \sin (d x))}{2 d (a+i a \tan (c+d x))}+\frac {\sec (c+d x) \left (-\frac {\cos (c)}{4}+\frac {1}{4} i \sin (c)\right ) (\cos (d x)+i \sin (d x)) \sin (2 d x)}{d (a+i a \tan (c+d x))}+\frac {7 i \sec ^2(c+d x) (\cos (d x)+i \sin (d x)) (-\cos (c-d x)+\cos (c+d x)-i \sin (c-d x)+i \sin (c+d x))}{6 d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) (a+i a \tan (c+d x))}-\frac {i \sec ^4(c+d x) (\cos (d x)+i \sin (d x)) (-\cos (c-d x)+\cos (c+d x)-i \sin (c-d x)+i \sin (c+d x))}{6 d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) (a+i a \tan (c+d x))}+\frac {x \sec (c+d x) (\cos (d x)+i \sin (d x)) (-3 \sec (c)-i (3 \cos (c)+3 i \sin (c)) \tan (c))}{a+i a \tan (c+d x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 88, normalized size = 0.68
method | result | size |
derivativedivides | \(\frac {-2 \tan \left (d x +c \right )-\frac {i \left (\tan ^{4}\left (d x +c \right )\right )}{4}+\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}+i \left (\tan ^{2}\left (d x +c \right )\right )-\frac {11 i \ln \left (\tan \left (d x +c \right )-i\right )}{4}-\frac {1}{2 \left (\tan \left (d x +c \right )-i\right )}-\frac {i \ln \left (\tan \left (d x +c \right )+i\right )}{4}}{d a}\) | \(88\) |
default | \(\frac {-2 \tan \left (d x +c \right )-\frac {i \left (\tan ^{4}\left (d x +c \right )\right )}{4}+\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}+i \left (\tan ^{2}\left (d x +c \right )\right )-\frac {11 i \ln \left (\tan \left (d x +c \right )-i\right )}{4}-\frac {1}{2 \left (\tan \left (d x +c \right )-i\right )}-\frac {i \ln \left (\tan \left (d x +c \right )+i\right )}{4}}{d a}\) | \(88\) |
risch | \(\frac {11 x}{2 a}-\frac {i {\mathrm e}^{-2 i \left (d x +c \right )}}{4 d a}+\frac {6 c}{d a}-\frac {2 i \left (9 \,{\mathrm e}^{4 i \left (d x +c \right )}+10 \,{\mathrm e}^{2 i \left (d x +c \right )}+7\right )}{3 d a \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {3 i \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d a}\) | \(102\) |
norman | \(\frac {\frac {5 x}{2 a}+\frac {\tan ^{5}\left (d x +c \right )}{3 d a}+\frac {5 x \left (\tan ^{2}\left (d x +c \right )\right )}{2 a}-\frac {3 i}{2 d a}-\frac {5 \tan \left (d x +c \right )}{2 d a}-\frac {5 \left (\tan ^{3}\left (d x +c \right )\right )}{3 d a}+\frac {3 i \left (\tan ^{4}\left (d x +c \right )\right )}{4 d a}-\frac {i \left (\tan ^{6}\left (d x +c \right )\right )}{4 d a}}{1+\tan ^{2}\left (d x +c \right )}-\frac {3 i \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d a}\) | \(145\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 221 vs. \(2 (110) = 220\).
time = 0.38, size = 221, normalized size = 1.70 \begin {gather*} \frac {66 \, d x e^{\left (10 i \, d x + 10 i \, c\right )} + 3 \, {\left (88 \, d x - i\right )} e^{\left (8 i \, d x + 8 i \, c\right )} + 12 \, {\left (33 \, d x - 7 i\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + 2 \, {\left (132 \, d x - 49 i\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, {\left (33 \, d x - 34 i\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 36 \, {\left (-i \, e^{\left (10 i \, d x + 10 i \, c\right )} - 4 i \, e^{\left (8 i \, d x + 8 i \, c\right )} - 6 i \, e^{\left (6 i \, d x + 6 i \, c\right )} - 4 i \, e^{\left (4 i \, d x + 4 i \, c\right )} - i \, e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 3 i}{12 \, {\left (a d e^{\left (10 i \, d x + 10 i \, c\right )} + 4 \, a d e^{\left (8 i \, d x + 8 i \, c\right )} + 6 \, a d e^{\left (6 i \, d x + 6 i \, c\right )} + 4 \, a d e^{\left (4 i \, d x + 4 i \, c\right )} + a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.35, size = 219, normalized size = 1.68 \begin {gather*} \frac {- 18 i e^{4 i c} e^{4 i d x} - 20 i e^{2 i c} e^{2 i d x} - 14 i}{3 a d e^{8 i c} e^{8 i d x} + 12 a d e^{6 i c} e^{6 i d x} + 18 a d e^{4 i c} e^{4 i d x} + 12 a d e^{2 i c} e^{2 i d x} + 3 a d} + \begin {cases} - \frac {i e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text {for}\: a d e^{2 i c} \neq 0 \\x \left (\frac {\left (11 e^{2 i c} - 1\right ) e^{- 2 i c}}{2 a} - \frac {11}{2 a}\right ) & \text {otherwise} \end {cases} + \frac {11 x}{2 a} + \frac {3 i \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{a d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 2.43, size = 116, normalized size = 0.89 \begin {gather*} -\frac {\frac {33 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a} + \frac {3 i \, \log \left (i \, \tan \left (d x + c\right ) - 1\right )}{a} + \frac {3 \, {\left (-11 i \, \tan \left (d x + c\right ) - 9\right )}}{a {\left (\tan \left (d x + c\right ) - i\right )}} + \frac {3 i \, a^{3} \tan \left (d x + c\right )^{4} - 4 \, a^{3} \tan \left (d x + c\right )^{3} - 12 i \, a^{3} \tan \left (d x + c\right )^{2} + 24 \, a^{3} \tan \left (d x + c\right )}{a^{4}}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.07, size = 125, normalized size = 0.96 \begin {gather*} \frac {{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,a\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4\,a\,d}-\frac {2\,\mathrm {tan}\left (c+d\,x\right )}{a\,d}-\frac {1{}\mathrm {i}}{2\,a\,d\,\left (1+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,1{}\mathrm {i}}{a\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,11{}\mathrm {i}}{4\,a\,d}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^4\,1{}\mathrm {i}}{4\,a\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________